package cn.gigi.ipspringbootstarter.autoconfig;

import cn.gigi.ipspringbootstarter.config.SpringMvcConfig;
import cn.gigi.ipspringbootstarter.properties.IpProperties;
import cn.gigi.ipspringbootstarter.service.IpCountService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling // 开启定时任务
@Import({IpProperties.class, SpringMvcConfig.class})
public class IpAutoConfiguration {

    // 声明 IpCountService Bean，这样第三方引用坐标后，可以直接使用 @Autowired 注入 IpCountService 实例
    @Bean
    public IpCountService ipCountService() {
        return new IpCountService();
    }

}
